<script lang="ts" setup>
import { ref } from 'vue'
import { testData } from './smpledata'

const showFixed = ref(true)
const data = ref(testData)

function onClick(row: any, col: any) {
  console.log(row)
  uni.$tm.u.toast(`行:${String(row)},列${String(col)}`)
}
</script>

<template>
  <tm-app>
    <tm-sheet>
      <tm-text :font-size="24" _class="font-weight-b" label="基础示例,更多见文档" />
      <tm-tag label="显示左固定栏" @click="showFixed = !showFixed" />
      <tm-divider />
      <tm-table
        :show-header="true"
        :show-fixed="showFixed"
        :height="550"
        :width="638"
        :table-data="data"
        @row-click="onClick"
      />
    </tm-sheet>
  </tm-app>
</template>
